﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;

namespace EAGL.Display.Rendering
{
    public class SimpleLineRenderer: Renderer
    {
        #region =================== PROTECTED ====================

        protected Color color;
        protected double width;
        protected esriSimpleLineStyle style;

        protected override void createRenderer()
        {
            ISimpleLineSymbol lsym = new SimpleLineSymbolClass();
            lsym.Color = ColorManager.GetESRIColor(this.color);
            lsym.Width = this.width;
            lsym.Style = this.style;

            ISimpleRenderer r = new SimpleRendererClass();
            r.Symbol = lsym as ISymbol;
            r.Label = this.label;
            r.Description = description;
            this.renderer = r as IFeatureRenderer;
        }


        #endregion

        #region ==================== PUBLIC ======================

        public SimpleLineRenderer(string Label, string Description)
        {
            this.label = Label;
            this.description = Description;

            // assign default values
            this.color = Color.Beige;
            this.style = esriSimpleLineStyle.esriSLSSolid;
            this.width = 1;
        }

        public SimpleLineRenderer(string Label)
            : this(Label, "") { }

        public SimpleLineRenderer()
            : this("") { }


        public Color Color
        {
            get { return this.color; }
            set { this.color = value; }
        }

        public esriSimpleLineStyle Style
        {
            get { return this.style; }
            set { this.style = value; }
        }

        public double Width
        {
            get { return this.width; }
            set { this.width = value; }
        }
    }

        #endregion

}
